<template>
    <div id='' class='system_set_form'>
        <Tabs :animated="false">
            <TabPane label="基本信息">
                <addUpdata_info ref="addUpdataInfoRef"></addUpdata_info>
            </TabPane>
            <TabPane label="关联人员">
                <addUpdata_personnel ref="addUpdataPersonnelRef"></addUpdata_personnel>
            </TabPane>
            <TabPane label="功能权限">
                <addUpdata_function ref="addUpdataFunctionRef"></addUpdata_function>
            </TabPane>
        </Tabs>
    </div>
</template>
<script>
import addUpdataInfo from "./addUpdata_info";
import addUpdataPersonnel from "./addUpdata_personnel";
import addUpdataFunction from "./addUpdata_function";
export default {
    name: '',
    props: [''],
    data() {
        return {};
    },
    components: {
        'addUpdata_info': addUpdataInfo,
        'addUpdata_personnel': addUpdataPersonnel,
        'addUpdata_function': addUpdataFunction,
    },
    computed: {},
    beforeMount() { },
    mounted() { },
    methods: {
        getFormData(cb) {
            this.$refs['addUpdataInfoRef'].handleSubmit(res => {
                let arr1 = this.$refs['addUpdataPersonnelRef'].getCheckList();
                let arr2 = this.$refs['addUpdataFunctionRef'].getCheckList();
                let data = {
                    ...res,
                    ...{ userIds: arr1 },
                    ...{ menus: arr2 }
                }
                if (cb) {
                    cb(data)
                }
            })
        },
        setData(row, treeData) {
            this.$refs['addUpdataInfoRef'].assignData(row)
            this.$refs['addUpdataPersonnelRef'].setTreeList(treeData.deptTreeAllList)
            this.$refs['addUpdataFunctionRef'].setTreeList(treeData.authenMenuTreeList)
        },
        setTreeList(type, data) {
            type == 'glryTree' && this.$refs.addUpdataPersonnelRef.setTreeList(data);
            type == 'gnqxTree' && this.$refs.addUpdataFunctionRef.setTreeList(data);
        }

    },
    watch: {}
}
</script>
<style lang='less' scoped>
</style>
